module.exports = function(window, document) {
	var apivm = require('../../common/avm.min')(window, document);
	var avm = apivm;
	var api = apivm.api;
	var Component = apivm.Component;
	var $ = apivm.$;
	(function() {
	var StatusBarView = /*@__PURE__*/ (function(Component) {
		function StatusBarView(props) {
			Component.call(this, props);
			this.compute = {
				statusBarHeight: function() {
					if (api.safeArea) {
						return api.safeArea.top;
					} else {
						var res = wx.getSystemInfoSync();
						return res.statusBarHeight;
					}
				}
			};
		}

		if (Component) StatusBarView.__proto__ = Component;
		StatusBarView.prototype = Object.create(Component && Component.prototype);
		StatusBarView.prototype.constructor = StatusBarView;
		StatusBarView.prototype.render = function() {
			return apivm.h("view", {style: "height:" + this.statusBarHeight + "px;"});
		};

		return StatusBarView;
	})(Component);
	apivm.define("status-bar-view", StatusBarView);

	var Navigationbar = /*@__PURE__*/ (function(Component) {
		function Navigationbar(props) {
			Component.call(this, props);
		}

		if (Component) Navigationbar.__proto__ = Component;
		Navigationbar.prototype = Object.create(Component && Component.prototype);
		Navigationbar.prototype.constructor = Navigationbar;
		Navigationbar.prototype.onLeftButton = function(e) {
			api.closeWin();
		};
		Navigationbar.prototype.render = function() {
			return apivm.h(
				"view",
				{class: "nav-container"},
				apivm.h("status-bar-view", null),
				apivm.h(
					"view",
					{class: "nav-header"},
					apivm.h(
						"view",
						{
							class: "nav-header-button nav-left-button",
							onclick: this.props.onLeftButton
								? this.props.onLeftButton
								: this.onLeftButton
						},
						apivm.h("image", {
							width: this.props.leftButtonWidth ? this.props.leftButtonWidth : 11,
							src: this.props.leftButtonIcon
								? this.props.leftButtonIcon
								: "../../image/back.png",
							mode: "widthFix"
						}),
						apivm.h("text", {class: "nav-header-text"}, this.props.leftButtonText)
					),
					apivm.h("text", {class: "nav-header-title"}, this.props.title),
					apivm.h(
						"view",
						{
							class: "nav-header-button nav-right-button",
							onclick: this.props.onRightButton
						},
						apivm.h("image", {
							width: this.props.rightButtonWidth ? this.props.rightButtonWidth : 0,
							src: this.props.rightButtonIcon ? this.props.rightButtonIcon : "",
							mode: "widthFix"
						}),
						apivm.h("text", {class: "nav-header-text"}, this.props.rightButtonText)
					)
				)
			);
		};

		return Navigationbar;
	})(Component);
	apivm.define("navigationBar", Navigationbar);

	var Coupon = /*@__PURE__*/ (function(Component) {
		function Coupon(props) {
			Component.call(this, props);

			var itemHeight = parseInt((api.winWidth - 16) * 0.27);
			this.data = {
				itemHeight: itemHeight,
				dataList: []
			};
		}

		if (Component) Coupon.__proto__ = Component;
		Coupon.prototype = Object.create(Component && Component.prototype);
		Coupon.prototype.constructor = Coupon;
		Coupon.prototype.apiready = function() {
			var data = [
				{
					price: "50￥",
					name: "APP新客户50元体验卷",
					condition: "满99元使用（含运费）",
					date: "有效期至2021年10月1日"
				},
				{
					price: "30￥",
					name: "APP新客户30元体验卷",
					condition: "满99元使用（含运费）",
					date: "有效期至2021年10月1日"
				}
			];

			this.data.dataList = data;
		};
		Coupon.prototype.render = function() {
			var this$1 = this;
			return apivm.h(
				"view",
				{class: "main"},
				apivm.h("navigationBar", {title: "我的优惠券"}),
				apivm.h(
					"scroll-view",
					{class: "scrollView", "scroll-y": "true", bounces: "false"},
					apivm.h(
						"view",
						{class: "inputBar"},
						apivm.h("input", {class: "input", placeholder: "请输入优惠码"}),
						apivm.h("text", {class: "button"}, "兑换")
					)
				),
				apivm.h(
					"scroll-view",
					{class: "listView", "scroll-y": "true"},
					Object.entries(this.data.dataList).map(function(ref) {
						var index$1 = ref[0];
						var item$1 = ref[1];
						return apivm.h(
							"view",
							{class: "cell"},
							apivm.h(
								"view",
								{style: "height:" + this$1.data.itemHeight + "px;", class: "item"},
								apivm.h("image", {
									class: "item-bg",
									src: "../../image/coupon_background.png"
								}),
								apivm.h(
									"view",
									{class: "part1"},
									apivm.h("text", {class: "desc"}, "优惠券")
								),
								apivm.h(
									"view",
									{class: "part2"},
									apivm.h("text", {class: "price"}, item$1.price)
								),
								apivm.h("view", {class: "part3"}),
								apivm.h(
									"view",
									{class: "part4"},
									apivm.h("text", {class: "part4-top"}, item$1.name),
									apivm.h("text", {class: "part4-middle"}, item$1.condition),
									apivm.h("text", {class: "part4-bottom"}, item$1.date)
								)
							)
						);
					})
				)
			);
		};

		return Coupon;
	})(Component);
	apivm.define("coupon", Coupon);
	apivm.render(apivm.h("coupon", null), "body");
})();

	window['createApp'] = function() {
		apivm.$_start();
	}
	return avm;
}